authApp.value('page','datafill'); 
authApp.controller("teachDataController",function($scope,$http,$cookies,$getQueryString){
	if($getQueryString("isfill")=="2"){
		$scope.isHideAction=true;
		$scope.isDisabled=true;
	}
	if($getQueryString("isfill")=="1"){
		$scope.isShowAction=true;
		$scope.isHideAction=true;
	}
	$scope.savaInfo=function(type){
		var confirmHtml="是否保存";
		if(type=="sub"){
			confirmHtml="是否提交";
		}
		if(window.confirm(confirmHtml)){
			var methodUrl=apis.insertTeachResource1;
			var methodStatus="0";
			var alertMsg="保存成功";
			if($getQueryString("isfill")=="1"){
				methodUrl=apis.updateTeachResourceData1;
			}else if($getQueryString("isfill")=="0"){
				methodUrl=apis.insertTeachResource1;
			}else{
				$scope.isHideAction=true;
			}
			if(type=="su"){
				methodStatus="0";
				alertMsg="保存成功";
			}else if(type=="sub"){
				methodStatus="1";
				alertMsg="提交成功";
			}
			$http({
				method:'post',
				url:methodUrl,
				data:{
					'latestProfessionalConstructionTime':$scope.latestProfessionalConstructionTime,
					'professionalTrainingProgram':$scope.professionalTrainingProgram,
					'requiredCoursesNum':$scope.requiredCoursesNum,
					'electiveCoursesNum':$scope.electiveCoursesNum,
					'onlineCourseTime':$scope.onlineCourseTime,
					'onlineAssessmentTime':$scope.onlineAssessmentTime,
					'teachingCycle':$scope.teachingCycle,
					'teachingSatisfaction':$scope.teachingSatisfaction,
					'creditSystemTime':$scope.creditSystemTime,
					'basicCourseCredit':$scope.basicCourseCredit,
					'professionalCourseCredits':$scope.professionalCourseCredits,
					'curriculumCredits':$scope.curriculumCredits,
					'countyNum':$scope.countyNum,
					'practiceBase':$scope.practiceBase,
					'educationPracticeBase':$scope.educationPracticeBase,
					'teachingPracticeTime':$scope.teachingPracticeTime,
					'educationalProbation':$scope.educationalProbation,
					'educationalPractice':$scope.educationalPractice,
					'educationalPracticeTime':$scope.educationalPracticeTime,
					'baseInstructor':$scope.baseInstructor,
					'ratioTeacherStudent':$scope.ratioTeacherStudent,
					'fulltimeTeachersLatest':$scope.fulltimeTeachersLatest,
					'parttimeTeachersLatest':$scope.parttimeTeachersLatest,
					'status':methodStatus,
					'remark1':$scope.remark1,
					'remark2':$scope.remark2,
					'remark3':$scope.remark3,
					'remark4':$scope.remark4,
					'remark5':$scope.remark5,
					'remark6':$scope.remark6,
					'remark7':$scope.remark7,
					'remark8':$scope.remark8,
					'remark9':$scope.remark9,
					'remark10':$scope.remark10,
					'remark11':$scope.remark11,
					'remark12':$scope.remark12,
					'remark13':$scope.remark13,
					'remark14':$scope.remark14,
					'remark15':$scope.remark15,
					'remark16':$scope.remark16,
					'remark17':$scope.remark17,
					'remark18':$scope.remark18,
					'remark19':$scope.remark19,
					'remark20':$scope.remark20,
					'remark21':$scope.remark21,
					'remark22':$scope.remark22,
					'remark23':$scope.remark23,
				},
			}).success(function(response){
				if(response.code=="000000"){
					alert(alertMsg);
					location.href="../datafill.html";
				}else{
					alert(response.errorMsg);
				}
				$scope.judeAllList=response.data;
			})
		}
	}
	$scope.getInfo=function(){
		$http({
			method:'get',
			url:apis.queryTeacherResourceDataBySchoolId1,
			data:{
			},
		}).success(function(response){
			if(response.code=="000000"){
				$scope.latestProfessionalConstructionTime=response.data.latestProfessionalConstructionTime;
				$scope.professionalTrainingProgram=response.data.professionalTrainingProgram;
				$scope.requiredCoursesNum=response.data.requiredCoursesNum;
				$scope.electiveCoursesNum=response.data.electiveCoursesNum;
				$scope.onlineCourseTime=response.data.onlineCourseTime;
				$scope.onlineAssessmentTime=response.data.onlineAssessmentTime;
				$scope.teachingCycle=response.data.teachingCycle;
				$scope.teachingSatisfaction=response.data.teachingSatisfaction;
				$scope.creditSystemTime=response.data.creditSystemTime;
				$scope.basicCourseCredit=response.data.basicCourseCredit;
				$scope.professionalCourseCredits=response.data.professionalCourseCredits;
				$scope.curriculumCredits=response.data.curriculumCredits;
				$scope.countyNum=response.data.countyNum;
				$scope.practiceBase=response.data.practiceBase;
				$scope.educationPracticeBase=response.data.educationPracticeBase;
				$scope.teachingPracticeTime=response.data.teachingPracticeTime;
				$scope.educationalProbation=response.data.educationalProbation;
				$scope.educationalPractice=response.data.educationalPractice;
				$scope.educationalPracticeTime=response.data.educationalPracticeTime;
				$scope.baseInstructor=response.data.baseInstructor;
				$scope.ratioTeacherStudent=response.data.ratioTeacherStudent;
				$scope.fulltimeTeachersLatest=response.data.fulltimeTeachersLatest;
				$scope.parttimeTeachersLatest=response.data.parttimeTeachersLatest;
				/*$scope.totalLibraryCollection=response.data.totalLibraryCollection;
				$scope.electronicBooks=response.data.electronicBooks;
				$scope.relatedProfessionalBooks=response.data.relatedProfessionalBooks;
				$scope.studentRelatedProfessionalBooks=response.data.studentRelatedProfessionalBooks;
				$scope.recommendedBook=response.data.recommendedBook;
				$scope.averageAnnualBook=response.data.averageAnnualBook;
				$scope.readingroomJournals=response.data.readingroomJournals;
				$scope.studentsFreeReading=response.data.studentsFreeReading;
				$scope.studentsDigitalResources=response.data.studentsDigitalResources;
				$scope.professionalJournals=response.data.professionalJournals;
				$scope.skillsTrainingRoomArea=response.data.skillsTrainingRoomArea;
				$scope.sharedArea=response.data.sharedArea;
				$scope.skillsTrainingRoomTypes=response.data.skillsTrainingRoomTypes;
				$scope.sharedRoom=response.data.sharedRoom;
				$scope.equipmentCost=response.data.equipmentCost;
				$scope.sharedDeviceValue=response.data.sharedDeviceValue;*/
				$scope.remark1=response.data.remark.split("#")[0];
				$scope.remark2=response.data.remark.split("#")[1];
				$scope.remark3=response.data.remark.split("#")[2];
				$scope.remark4=response.data.remark.split("#")[3];
				$scope.remark5=response.data.remark.split("#")[4];
				$scope.remark6=response.data.remark.split("#")[5];
				$scope.remark7=response.data.remark.split("#")[6];
				$scope.remark8=response.data.remark.split("#")[7];
				$scope.remark9=response.data.remark.split("#")[8];
				$scope.remark10=response.data.remark.split("#")[9];
				$scope.remark11=response.data.remark.split("#")[10];
				$scope.remark12=response.data.remark.split("#")[11];
				$scope.remark13=response.data.remark.split("#")[12];
				$scope.remark14=response.data.remark.split("#")[13];
				$scope.remark15=response.data.remark.split("#")[14];
				$scope.remark16=response.data.remark.split("#")[15];
				$scope.remark17=response.data.remark.split("#")[16];
				$scope.remark18=response.data.remark.split("#")[17];
				$scope.remark19=response.data.remark.split("#")[18];
				$scope.remark20=response.data.remark.split("#")[19];
				$scope.remark21=response.data.remark.split("#")[20];
				$scope.remark22=response.data.remark.split("#")[21];
				$scope.remark23=response.data.remark.split("#")[22];
				$scope.remark24=response.data.remark.split("#")[23];
			}
		})
	}
	if($getQueryString("isfill")=="1"||$getQueryString("isfill")=="2"){
		$scope.getInfo();
	}
})